package com.xjh.controller;

import com.xjh.bo.CategoryBO;
import com.xjh.service.CategoryService;
import com.xjh.utils.resultutils.ResponseObj;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author XuJianHua
 * @version 1.0
 * @company 湖南安第斯信息科技有限公司, 版权所有
 * @date 2022/5/18 18:13
 */
@RestController
@RequestMapping("/api/category")
public class CategoryController {
    @Autowired
    private CategoryService categoryService;

    @GetMapping("/list")
    public Object list() {
        List<CategoryBO> categoryList = categoryService.getCategoryList();
        ResponseObj responseObj = new ResponseObj();
        return responseObj.ok(categoryList);
    }
}
